package org.dlx.drpc.core.client;

import io.netty.channel.ChannelFuture;

public class RPCConn
{
    protected ChannelFuture conn;
    protected boolean owner;

    public RPCConn(ChannelFuture future, boolean owner){
        this.conn = future;
        this.owner = owner;
    }

    public RPCConn(ChannelFuture future){
        this.conn = future;
        this.owner = true;
    }
    //关闭
    public void close(){
        if(!this.owner)//链接时外面控制的 可以让外面Close
            this.conn.channel().pipeline().close();
    }
}
